import React, { Component } from 'react';
import './Banner.scss'

// import banner from '../imgs/banner.png'
import { Lunbotu } from '../utils/aip'

class LunBoTu extends Component {
    constructor(props) {
        super(props);
        // console.log('constructor');
        this.state = { arr: [] } //初始化组件状态
    }
    componentDidMount() {
        Lunbotu().then((ok) => {
            // console.log(ok.data)
            // this.state.arr = ok.data.list
            this.setState(this.state.arr = ok.data.list)
            // console.log(this.state.arr)
        })
    }
    render() {
        return (
            <div className='box'>
                {
                    this.state.arr.map((v, i) => {
                        return (
                            <img src={v.pic} alt="" />
                        )
                    })
                }
            </div>
        );
    }

}

export default LunBoTu;
